package com.buka.mapper;

import com.buka.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {

    @Insert("insert into t_user values (null,#{userUsername},#{userPassword},1)")
    int add(User user);


    @Select("select * from t_user where user_username = #{username}")
    User getUserByUsername(String username);

    @Select("select * from t_user")
    List<User> getUserList();

    @Update("update t_user set user_state = #{state} where user_id = #{userId}")
    int changeForStateById(@Param("userId") int userId, @Param("state") int state);
}
